using UnityEngine;
using System.Collections;

public class Missle : MonoBehaviour {
	
	public int moveSpeed = 50;
	Vector3 moveDirection = new Vector3(0,-1,0);
	public int score = 0;
	public GameObject Bomb;
	public GameObject bottomPaddle;
	public GameObject middlePaddle;
	public GameObject topPaddle;
	
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
		Vector3 newPosition = moveDirection * (moveSpeed * Time.deltaTime);
		transform.position = transform.position + newPosition;
		
		
		
	}
	
	public void OnCollisionEnter(Collision collision)
	{

		if(collision.rigidbody)
		{
			Destroy(gameObject);
		}
		
		// for score incrementing
		/*if(Bomb == topPaddle)
		{
			score += 1;	
		}
		
		if(bottomPaddle == false)
		{
			ScoreKeeper.addToScore(pointvalue);
		}*/
		
	}
	
	public void OnGUI()
	{
		GUILayout.BeginArea(new Rect(10,10,Screen.width/4,Screen.height/4));
		GUILayout.Box ("Score:" + score.ToString());
		GUILayout.EndArea();
	}
	
	
	
	
	
	
	
}
